;;! target = "riscv64"
;;!
;;! settings = ['enable_heap_access_spectre_mitigation=true']
;;!
;;! compile = true
;;!
;;! [globals.vmctx]
;;! type = "i64"
;;! vmctx = true
;;!
;;! [globals.heap_base]
;;! type = "i64"
;;! load = { base = "vmctx", offset = 0, readonly = true }
;;!
;;! [globals.heap_bound]
;;! type = "i64"
;;! load = { base = "vmctx", offset = 8, readonly = true }
;;!
;;! [[heaps]]
;;! base = "heap_base"
;;! min_size = 0x10000
;;! offset_guard_size = 0
;;! index_type = "i32"
;;! style = { kind = "dynamic", bound = "heap_bound" }

;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
;; !!! GENERATED BY 'make-load-store-tests.sh' DO NOT EDIT !!!
;; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

(module
  (memory i32 1)

  (func (export "do_store") (param i32 i32)
    local.get 0
    local.get 1
    i32.store offset=0xffff0000)

  (func (export "do_load") (param i32) (result i32)
    local.get 0
    i32.load offset=0xffff0000))

;; function u0:0:
;; block0:
;;   slli a0,a0,32
;;   srli a3,a0,32
;;   lui a5,262140
;;   addi a4,a5,1
;;   slli a4,a4,2
;;   add a4,a3,a4
;;   trap_if heap_oob##(a4 ult a3)
;;   ld a5,8(a2)
;;   sltu a4,a5,a4
;;   ld a2,0(a2)
;;   add a2,a2,a3
;;   lui a3,65535
;;   slli a3,a3,4
;;   add a2,a2,a3
;;   sub a0,zero,a4
;;   not a3,a0
;;   and a4,a2,a3
;;   sw a1,0(a4)
;;   j label1
;; block1:
;;   ret
;;
;; function u0:1:
;; block0:
;;   slli a0,a0,32
;;   srli a2,a0,32
;;   lui a5,262140
;;   addi a3,a5,1
;;   slli a3,a3,2
;;   add a3,a2,a3
;;   trap_if heap_oob##(a3 ult a2)
;;   ld a4,8(a1)
;;   sltu a3,a4,a3
;;   ld a4,0(a1)
;;   add a2,a4,a2
;;   lui a1,65535
;;   slli a4,a1,4
;;   add a2,a2,a4
;;   sub a0,zero,a3
;;   not a3,a0
;;   and a4,a2,a3
;;   lw a0,0(a4)
;;   j label1
;; block1:
;;   ret
